from selenium.webdriver.common.by import By


class  AdminTicketManagementLocator:

    """
        20240417
    """
    # 退出图标
    out_image = (By.XPATH,'//*[@class="antd4-avatar antd4-avatar-circle antd4-avatar-image antd4-dropdown-trigger"]')
    # 退出按钮
    click_log_out = (By.XPATH,'//*[text()="Log Out"]')

    # Ticket菜单
    ticket_tab = (By.XPATH, "//div[contains(@data-menu-id,'TICKET')]")
    # ticket management菜单
    ticket_management_tab = (By.CSS_SELECTOR, '[path="/console/tickets/ticketManagement"]')
    # Dashboard菜单
    dashboard_tab = (By.XPATH, "//div[contains(@data-menu-id,'DASHBOARD')]")
    # Bill菜单
    bill_tab = (By.XPATH, "//div[contains(@data-menu-id,'BILL')]")
    #Auto-Assignment settings tab
    aas_tab = (By.XPATH, "(//div[contains(@class,'antd4-tabs-tab-btn')])[1]")

    #Aging of SLA tab
    aos_tab = (By.XPATH, "(//div[contains(@class,'antd4-tabs-tab-btn')])[2]")

    #SLA-Based notification tab
    sbn_tab =  (By.XPATH, "(//div[contains(@class,'antd4-tabs-tab-btn')])[3]")

    #edit
    edit_button = (By.XPATH,'//*[text()="Edit"]/..')

    # submit button
    submit_button = (By.XPATH, "//button[contains(@class,'antd4-btn-primary')]")

    #cancel button
    cancel_button = (By.XPATH, "//button[contains(@class,'antd4-btn-default')]")

    #auto assigement 开关
    auto_assigenment_switch = (By.ID, 'autoAssignPolicy')

    #queue up mechanic 输入框（允许被分配的工单数量最大值）
    ticket_amount_limitation = (By.ID,'queueUpMechanicValue')

    ticket_amount_limitation_view = (By.XPATH, "//div[contains(@class,'tabOneContentText___3RKTP')]")

    #确认关闭自动分配工单
    auto_assigenment_switch_confirm =  (By.XPATH, "(//button[contains(@class,'antd4-btn-primary')])[2]")

    #自动分配开关 仅查看状态
    auto_assigenment_switch_view = (By.ID,'AUTO_ASSIGN_POLICY')


    #Aging of sla页面的输入框
    high_response_time_day = (By.ID,'highResponseTimeDays')
    high_response_time_hour = (By.ID, 'highResponseTimeHours')
    high_response_time_min = (By.ID, 'highResponseTimeMinutes')
    medium_response_time_day = (By.ID, 'mediumResponseTimeDays')
    medium_response_time_hour = (By.ID, 'mediumResponseTimeHours')
    medium_response_time_min = (By.ID, 'mediumResponseTimeMinutes')
    low_response_time_day = (By.ID, 'lowResponseTimeDays')
    low_response_time_hour = (By.ID, 'lowResponseTimeHours')
    low_response_time_min = (By.ID, 'lowResponseTimeMinutes')

    high_processing_time_day = (By.ID,'highProcessingTimeDays')
    high_processing_time_hour = (By.ID, 'highProcessingTimeHours')
    high_processing_time_min = (By.ID, 'highProcessingTimeMinutes')
    medium_processing_time_day = (By.ID, 'mediumProcessingTimeDays')
    medium_processing_time_hour = (By.ID, 'mediumProcessingTimeHours')
    medium_processing_time_min = (By.ID, 'mediumProcessingTimeMinutes')
    low_processing_time_day = (By.ID, 'lowProcessingTimeDays')
    low_processing_time_hour = (By.ID, 'lowProcessingTimeHours')
    low_processing_time_min = (By.ID, 'lowProcessingTimeMinutes')

    #edit successfully
    edit_confirm = (By.XPATH,'/div/div/div/span[2]')

    #Aging of sla页面的值
    high_response_time = (By.XPATH,'//*[text()="High"]/../div[3]')
    high_processing_time = (By.XPATH,'//*[text()="High"]/../div[6]')
    medium_response_time = (By.XPATH, '//*[text()="Medium"]/../div[3]')
    medium_processing_time = (By.XPATH, '//*[text()="Medium"]/../div[6]')
    low_response_time = (By.XPATH,'//*[text()="Low"]/../div[3]')
    low_processing_time = (By.XPATH,'//*[text()="Low"]/../div[6]')

    #Notify Ticket Assigner的输入框
    nta_high_day = (By.ID,'highSubmitTimeDays')
    nta_high_hour = (By.ID,'highSubmitTimeHours')
    nta_high_min = (By.ID,'highSubmitTimeMinutes')
    nta_medium_day = (By.ID,'mediumSubmitTimeDays')
    nta_medium_hour = (By.ID,'mediumSubmitTimeHours')
    nta_medium_min = (By.ID, 'mediumSubmitTimeMinutes')
    nta_low_day = (By.ID,'lowSubmitTimeDays')
    nta_low_hour = (By.ID,'lowSubmitTimeHours')
    nta_low_min = (By.ID,'lowSubmitTimeMinutes')
    nta_ticket_amount_limitation = (By.ID,'unassignedLimitation')
    nta_frequency = (By.ID,'submitOutFrequencyUnassigned')

    # Notify Support Member的输入框
    nsm_high_day = (By.ID, 'highAssignTimeDays')
    nsm_high_hour = (By.ID, 'highAssignTimeHours')
    nsm_high_min = (By.ID, 'highAssignTimeMinutes')
    nsm_medium_day = (By.ID, 'mediumAssignTimeDays')
    nsm_medium_hour = (By.ID, 'mediumAssignTimeHours')
    nsm_medium_min = (By.ID, 'mediumAssignTimeMinutes')
    nsm_low_day = (By.ID, 'lowAssignTimeDays')
    nsm_low_hour = (By.ID, 'lowAssignTimeHours')
    nsm_low_min = (By.ID, 'lowAssignTimeMinutes')
    nsm_ticket_amount_limitation = (By.ID, 'unsolvedLimitation')
    nsm_frequency = (By.ID, 'submitOutFrequencyUnsolved')

    #Notify Ticket Assigner的数值
    nta_high = (By.XPATH,'(//*[text()="High"])[1]/../div[2]')
    nta_medium = (By.XPATH,'(//*[text()="Medium"])[1]/../div[2]')
    nta_low = (By.XPATH,'(//*[text()="Low"])[1]/../div[2]')
    nta_amount_limitation = (By.XPATH,'(//*[text()="Set ticket amount limitation"])[2]/../../div[2]/div/div/div')
    nta_fre = (By.XPATH,'(//*[text()="Set notification sending out frequency"])[1]/../../div[2]/div/div/div')

    nsm_high = (By.XPATH,'(//*[text()="High"])[2]/../div[2]')
    nsm_medium = (By.XPATH,'(//*[text()="Medium"])[2]/../div[2]')
    nsm_low = (By.XPATH,'(//*[text()="Low"])[2]/../div[2]')
    nsm_amount_limitation = (By.XPATH,'(//*[text()="Set ticket amount limitation"])[3]/../../div[2]/div/div/div')
    nsm_fre = (By.XPATH,'(//*[text()="Set notification sending out frequency"])[2]/../../div[2]/div/div/div')

    nta_high_error = (By.XPATH,'(//*[@role="alert" and contains(text(),"Cannot be")])[1]')
    nsm_gigh_error = (By.XPATH,'(//*[@role="alert" and contains(text(),"Cannot be")])[2]')

    high_response_time_error = (By.XPATH,'(//*[@role="alert" and contains(text(),"Cannot be")])[1]')
    high_processing_time_error = (By.XPATH,'(//*[@role="alert" and contains(text(),"Cannot be")])[2]')